<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
    <link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
    <div style="margin:0 auto;padding:20px;">
        <form class="layui-form" action="" id="showForm" autocomplete="off">
            <div class="layui-form-item layui-col-xs12">
                <span class="hr-title">基础信息</span><hr>
            </div>
            <div class="layui-form-item layui-col-xs12">
                <label class="layui-form-label">标题<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="title" name="title" win-verify="required" placeholder="请输入标题" class="layui-input" maxlength="100"/>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">属性<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="attrCode" name="attrCode" win-verify="required" placeholder="请输入属性" class="layui-input" maxlength="100"/>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">编辑器类型<i class="red">*</i></label>
                <div class="layui-input-block">
                    <select id="editorType" name="editorType" lay-search win-verify="required">

                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs12">
                <span class="hr-title">属性值信息</span><hr>
            </div>
            <div class="layui-form-item layui-col-xs12">
                <label class="layui-form-label">是否可选<i class="red">*</i></label>
                <div class="layui-input-block winui-radio">
                    <input type="radio" name="optional" value="1" title="可选" lay-filter="optional" />
                    <input type="radio" name="optional" value="2" title="不可选" lay-filter="optional" checked/>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs12" id="canNotChoose">
                <label class="layui-form-label">默认值<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="defaultValue" name="defaultValue" placeholder="请输入默认值" class="layui-input" maxlength="300"/>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs12" style="display: none" id="canChoose">
                <label class="layui-form-label">属性值选项：</label>
                <div class="layui-input-block">
                    <div class="winui-toolbar">
                        <div class="winui-tool" style="text-align: left;">
                            <button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
                            <button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
                        </div>
                    </div>
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 30px;"></th>
                            <th style="width: 150px;">标题</th>
                            <th style="width: 150px;">属性值<i class="red">*</i></th>
                            <th style="width: 200px;">是否默认<i class="red">*</i></th>
                        </tr>
                        </thead>
                        <tbody id="useTable" class="insurance-table">
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="layui-form-item layui-col-xs12">
                <div class="layui-input-block">
                    <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
                    <button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
                </div>
            </div>
        </form>
    </div>

    <!-- usetableTemplate -->
    <script type="text/x-handlebars-template" id="usetableTemplate">
        <tr trcusid="{{trId}}">
            <td><input type="checkbox" rowId="{{id}}" lay-filter="checkboxProperty" name="tableCheckRow"/></td>
            <td><input type="text" class="layui-input" id="{{title}}"/></td>
            <td><input type="text" class="layui-input" id="{{value}}" win-verify="required"/></td>
            <td>
                <div class="winui-radio">
                    <input type="radio" name="{{defaultChoose}}" value="1" title="是" lay-filter="{{defaultChoose}}" />
                    <input type="radio" name="{{defaultChoose}}" value="2" title="否" lay-filter="{{defaultChoose}}" checked/>
                </div>
            </td>
        </tr>
    </script>

    <script src="../../assets/lib/layui/layui.js"></script>
    <script src="../../assets/lib/layui/custom.js"></script>
    <script src="../../assets/report/js/reportCustom.js"></script>
    <script type="text/javascript">
        layui.config({base: '../../js/reportProperty/'}).use('reportPropertyAdd');
    </script>
</body>
</html>